package zombiegame;


/**
 * Parent Character class
 * @author NKD
 * POTIER LE PéDé
 */
public class Character {
    protected String name; // name of the character
    protected int healthPoints; // represents the health
    private Location location; //The position
    private Field field; // The field occupied.
    // (once down to 0, this character will be destroyed)
    /**
     * Constructor of Character class.
     * @param name name of the character
     * @param healthPoints initial HP
     */
    public Character(String name, int healthPoints, Location location, Field field) {
        this.name = name;
        this.healthPoints = healthPoints;
        this.field = field;
        this.location = location;
    }
    public Location getLocation() {
		return location;
	}
	public void setLocation(Location location) {
		this.location = location;
	}
	public Field getField() {
		return field;
	}
	public void setField(Field field) {
		this.field = field;
	}
	// Accessors
    public String getName() {
        return name;
    }
    public int getHealthPoints() {
        return healthPoints;
    }
    /**
     * Decrease the number of HP by a certain amount. HP cannot go below 0.
     * @param reduction number of HP to reduce
     */
    public void reduceHealthPoints(int reduction) {
        healthPoints = healthPoints - reduction;
        if (healthPoints < 0) {
            healthPoints = 0;
        }
    }
    /**
     * Output a character's saying to the screen
     * @param str what the character says
     */
    public void say(String str) {
        System.out.println(name + " says: " + str);
    }
    /**
     * Method triggered when the character described by the current object
     * meets another character, and does something to him (for example, attack).
     * @param c the other character that this character meets
     */
    public void encounterCharacter(Character c) {
        // Default action: do nothing
        System.out.println(name + " meets " + c.name + " and does not attack!");
    }
    
    public void endOfTurn(){
    
    }
}